# Contributor: Fabricio Silva <hi@fabricio.dev>
# Maintainer: Fabricio Silva <hi@fabricio.dev>
pkgname=py3-sabctools
_pkgname=sabctools
pkgver=8.1.0
pkgrel=1
pkgdesc="C implementations of functions for use within SABnzbd"
url="https://github.com/sabnzbd/sabctools"
arch="all"
license="GPL-2.0-or-later AND Apache-2.0 AND CC0-1.0"
makedepends="
	linux-headers
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="
	py3-chardet
	py3-jaraco.functools
	py3-portend
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/sabnzbd/sabctools/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
862c39f2e386622b528f120a431f214e1e2e92b7c5a751e47d0768f40ce06ad2736d867f7ac2e1810d676e980312bbfedd29951cbadeddefe75246cdcf53fcc6  py3-sabctools-8.1.0.tar.gz
"
